#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QThread>
#include <QTimer>
#include "recorder.h"
#include <QElapsedTimer>
#include "main.h"
#include "math.h"

class tracker;

class mythread : public QThread
{
    Q_OBJECT
public:
    explicit mythread(QObject *parent = 0);
   // uint count;
    void stop();
    void run();
    inline  void pulsing_vacuum();
    inline  void bottom_exhaust();
    inline  void leak_test();
    inline  void dry();
    float F0;
    bool pressure_balanced;
    recorder* rec;
signals:
    void leak_test_timer_on();
    void set_count_down_timer(uint);
    void set_status_display(uint);
public slots:
    void timeDone();
    void timeDone2();
    void calculate_F0();
    void condition_heating();
    //void timing_heat_timeout();
   // void period_heat_timeout();

private:
    QTimer* timer;
    QTimer* timer2;
    QTimer* F0_timer;
    QTimer* delay_heat_timer;
    QTimer* heat_timer;
    QTimer* period_heat_timer;

    int pressure[3];
    int low_temperature_counter;
    int condition_psu;
    int period_heat_time;
    float high_balance_temperature;
    float low_balance_temperature;
    bool stop_thread;
    bool condition;
    void low_temperature_process();
    void readdata();
    void delay_heating(int sec,bool condition);
  //  void timing_heat(int ms);
    void pressure_balance();
    bool sterilization_process();
//    int hPSU;
//    int lPSU;
    int bPSU;
    bool hTem;
    bool lTem;
};

#endif // MYTHREAD_H
